package demo;
import java.io.InputStream;

import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;


public class ConfigFileReader {	

	public String getIssuerUrl() throws XMLStreamException, FactoryConfigurationError {
		
		InputStream stream = null;
		XMLStreamReader reader = null;
		StAXOMBuilder builder = null;
		OMElement doc = null;
		OMElement element = null;
			
		stream = ConfigFileReader.class.getResourceAsStream("config.xml");
		
		reader = XMLInputFactory.newInstance().createXMLStreamReader(stream);
		builder = new StAXOMBuilder(reader);
		doc = builder.getDocumentElement();
		element = doc.getFirstElement();	
		
		return (element.getText());		
	}
}
